/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package cassys.domain.assessment;

import java.io.Serializable;

/**
 *
 * @author User
 */
public class AssessmentItem  implements Serializable {

    private double weightPercentage;
    private String name;

    public AssessmentItem() {
    }

    public AssessmentItem(String name, double weightpercentage) {
        this();
        this.name = name;
        this.weightPercentage = weightpercentage;

    }

    public double getWeightPercentage() {
        return weightPercentage;
    }

    public void setWeightPercentage(double weightPercentage) {
        this.weightPercentage = weightPercentage;
    }

    public double evaluate(double mark) {
        return mark * (this.getWeightPercentage() / 100);
    }
//    @Override
//    public boolean equals(Object obj) {
//        if (obj == null) {
//            return false;
//        }
//        if (getClass() != obj.getClass()) {
//            return false;
//        }
//        final AssessmentItem other = (AssessmentItem) obj;
//        if (other.getWeightPercentage() == this.getWeightPercentage()) {
//            return true;
//        } else {
//            return false;
//        }
//    }
//
//    @Override
//    public int hashCode() {
//        int hash = 7;
//        hash = 89 * hash + (int) (Double.doubleToLongBits(this.weightPercentage) ^ (Double.doubleToLongBits(this.weightPercentage) >>> 32));
//        hash = 89 * hash + (this.name != null ? this.name.hashCode() : 0);
//        return hash;
//    }

    /**
     * @return the name
     */
    public String getName() {
        return name;
    }

    /**
     * @param name the name to set
     */
    public void setName(String name) {
        this.name = name;
    }
}
